Repository navigation
db: add run_labels and run_to_run_labels - #5122
Conversation
barnabasdomozi
left a comment
There was a problem hiding this comment.
Currently, the linter tests are failing:
https://github.com/Ericsson/codechecker/actions/runs/36990197079/job/110784360627?pr=5122
Also, sorry for changing things around but I think it would make more sense to have two PRs instead:
- one for database related changes, including Alembic migration
- one for Thrift API changes, with server side implementation complete
This way, we can merge the changes to master.
So for this PR, only keep changes made to file web/server/codechecker_server/database/run_db_model.py and also implement the Alembic migration (guide here: https://github.com/Ericsson/codechecker/blob/master/docs/web/db_schema_guide.md).
Thanks!
| primary_key=True | ||
| ) | ||
|
|
||
| def __init__(self, run_id, run_label_id): |
There was a problem hiding this comment.
Please add type annotations for function parameters.
| label_name = Column(String, nullable=False, unique=True, index=True) | ||
| description = Column(String, nullable=True) | ||
|
|
||
| def __init__(self, label_name, description=None): |
There was a problem hiding this comment.
Please add type annotations for function parameters.
barnabasdomozi
left a comment
There was a problem hiding this comment.
As mentioned in my other comments, please add type annotations to the following functions:
def __init__(self, label_name, description=None)def __init__(self, run_id, run_label_id)
Apart from that, LGTM
| description = Column(String, nullable=True) | ||
|
|
||
| def __init__(self, label_name, description=None): | ||
| def __init__(self, label_name: String, description: String = None): |
There was a problem hiding this comment.
Instead of String, the built-in str type should be used here.
| label_name = Column(String, nullable=False, unique=True, index=True) | ||
| description = Column(String, nullable=True) | ||
|
|
||
| def __init__(self, label_name: str, description: str = None): |
There was a problem hiding this comment.
For description, the correct annotation is str | None.
barnabasdomozi
left a comment
There was a problem hiding this comment.
LGTM, great work!
Adding run_labels and run_to_run_labels for db and run label related API calls